Skip to content

fix(skills): drop the per-skill permissions keys — the field does not exist in SkillSchema - #511

Merged
os-zhuang merged 1 commit into
mainfrom
claude/agent-metadata-positioning-th5hhm
Jul 28, 2026
Merged

fix(skills): drop the per-skill permissions keys — the field does not exist in SkillSchema#511
os-zhuang merged 1 commit into
mainfrom
claude/agent-metadata-positioning-th5hhm

Conversation

@os-zhuang

Copy link
Copy Markdown
Contributor

All six skills declared permissions: ['crm:…']. SkillSchema has no such field, so Zod strips the key at parse time — it granted and restricted nothing while reading as a security control. That is the ADR-0049 prohibited shape (a security-shaped declaration that lies), flagged in objectstack-ai/objectstack#3820 §4.

Where access is actually gated:

  • agent levelagent.access / agent.permissions, enforced at the chat route;
  • tool level — each tool's own authz when invoked.

The spec now documents this directly on SkillSchema (objectstack-ai/objectstack#3871), so the next author — human or AI — is told before writing the key instead of having it silently vanish.

Diff is deletion-only (12 lines across 6 *.skill.ts). pnpm typecheck, objectstack validate, and the test suite (8 files / 67 tests) all pass.

Refs objectstack-ai/objectstack#3820 · sibling PRs objectstack-ai/objectstack#3871, objectstack-ai/cloud#904

🤖 Generated with Claude Code

https://claude.ai/code/session_01BHjroNkLkajskKbJaidko4


Generated by Claude Code

…ot exist in SkillSchema (objectstack#3820)

All six skills declared `permissions: ['crm:…']`. SkillSchema has no such
field, so Zod strips the key at parse time: it granted and restricted
nothing while reading as a security control — the ADR-0049 prohibited
shape, flagged in objectstack#3820 §4. Access to AI capability is gated at
the agent level (`agent.access`/`agent.permissions`, enforced at the chat
route) and by each tool's own authz; the spec now documents this on
SkillSchema itself (objectstack#3871).

typecheck, `objectstack validate`, and the test suite (67) all pass.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BHjroNkLkajskKbJaidko4
@vercel

vercel Bot commented Jul 28, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
hotcrm-docs Ready Ready Preview, Comment Jul 28, 2026 1:38pm

Request Review

@os-zhuang
os-zhuang marked this pull request as ready for review July 28, 2026 13:46
@os-zhuang
os-zhuang merged commit a257433 into main Jul 28, 2026
7 checks passed
yinlianghui pushed a commit that referenced this pull request Jul 31, 2026
#512 deleted `src/agents/` when the AI surface went skills-only, but seven
maintainer docs kept printing `src/agents/*.agent.ts` in their tree
diagrams and registration tables. `code_examples.md` was the worst of it:
after registering a skill it told the author to "add its name to an agent
in `src/agents/*.agent.ts`" — an instruction that cannot be followed.
`src/cubes/` had the same shape, dropped in favour of datasets (ADR-0021,
noted in objectstack.config.ts) and still drawn in two trees.

Nothing checked, because a path in prose is just prose. That is the same
failure mode as #493 one layer out: metadata validation sees a
well-formed string and stops, so the reference rots silently and the next
reader — human or agent — is sent somewhere that does not exist.

- README.md, AGENTS.md, docs/README.md, docs/STATUS.md,
  docs/ARCHITECTURE.md, docs/developers/code_examples.md: drop the agent
  and cube directories; README picks up `src/datasets/` (the layer that
  actually replaced cubes) and its flow count goes 20 → 23; AGENTS.md's
  `*.action.ts` becomes `*.actions.ts`, the real suffix.
- code_examples.md: drop the skill `permissions: [...]` key — SkillSchema
  has no such field and strips it silently (#511) — and fill the gap the
  deletions leave. The example now says which two sources a `tools` name
  can resolve to (platform data tools, or `action_<name>` from an
  `ai.exposed` Action with a headless path), why `defineTool` is not a
  third one, that reasoning belongs in `instructions` (ADR-0109), and
  where the guard lives.
- ARCHITECTURE.md: same note, plus the `case_triage` skill its table had
  been missing.

Adds a repo-tree guard to test/docs-drift.test.ts — every `src/<dir>/` a
maintainer doc names must resolve on disk, with `docs/archive/` excluded
as a historical record. It earned its place immediately by failing on a
stray `no src/agents/` parenthetical in this change's own first pass.

155 tests (+9), typecheck, validate and build pass; the 2 remaining
validate warnings are the pre-existing campaign_enrollment ones.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Y9STuduWbrAwcgviziaV4e
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants